#pragma once
#include "base/function.h"
#include "util/noncopyable.h"
#include "base/config.h"

#include <stdint.h>

#include <unistd.h>
namespace net_tools::base
{
  class Timebplustree;
  class Timeevent;
  class Timer;
  class Timequeue : util::noncopyable
  {
  public:
    Timequeue();
    ~Timequeue() = default;
    void Addtimeevent(Timeevent *p_timeevent);
    void Timeout();
    inline int Gettimefd() const { return timerfd_; };

  private:
    void Resettimer();
    Timer *timer_;
    int timerfd_;
    __time_t min_sec_;
    __suseconds_t min_usec_;
    timeval min_timeval_;
    uint64_t *time_out_read_buf;
    Timebplustree *timebplustree_;
  };

} // namespace net_tools::base